package cn.com.bluemoon.daps.domp.api;


import cn.com.bluemoon.daps.common.constant.ServiceNameConstants;
import cn.com.bluemoon.daps.common.domain.FeignApiRespBean;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.domp.api.param.UserDto;
import io.swagger.annotations.Api;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

@FeignClient(ServiceNameConstants.DapsApiSystem.PROD_SERVICE)
@RequestMapping(ServiceNameConstants.DapsApiSystem.BASE_URI)
@Api(
        tags = {"FeignClient服务-蓝数通bd-domp-service"}
)
public interface LocalDompService {
    Logger log = LoggerFactory.getLogger(LocalDompService.class);

    /**
     * @param username       username
     * @param password       passwrod加密后的
     * @return token
     */
    @PostMapping("/user/dompLogin")
    FeignApiRespBean<String> dompLogin(@RequestParam(name = "userId") String userId,
                                       @RequestParam(name = "password") String password,
                                       @RequestParam(name = "validationCode",required = false) String validationCode);



    /**
     * 获取用户菜单信息
     *
     * @param token  token
     * @param userId 用户id
     * @return 菜单数据
     */
    @PostMapping("/getMenuPathByTokenAndUserId")
    Map<String, List<MenuDto>> getMenuPathByTokenAndUserId(
            @RequestParam(name = "token")String token,
            @RequestParam(name = "userId")String userId);



    @Data
    public class MenuDto implements Serializable {
        private static final long serialVersionUID = 1L;
        private Integer menu_sort;
        private String menu_control;
        private String menu_icon_activated;
        private String menu_icon_unactivated;
        private Integer mid;
        private String menu_app_type;
        private Integer menu_parent_id;
        private String menu_name;
        private String menu_path;
        private String menu_level;
        private String menu_des;
        private String has_child;
        private String status;
    }
}
